{js:kindeditor}

<div class="">
<div class="">
	<legend>退款申请</legend>
</div>

	<div class="pending-detial">
		<form action="{url:/ucenter/refunds_update}" method="post" callback="checkForm();">
			<input type="hidden" name="order_id" value="{$this->orderRow['id']}" />


		<div class="form-group">
			<label for="input" class="col-sm-2 control-label">订单号:</label>
			<div class="col-sm-8">
				{$this->orderRow['order_no']}
			</div>


		</div>


		<div class="form-group">
			<div class="">
			<label for="input" class="col-sm-2 control-label">退款商品:</label>
		
				{foreach:items=Api::run('getOrderGoodsListByGoodsid',array('#order_id#',$this->orderRow['id'])) item=$good}
						{set:$good_info = JSON::decode($good['goods_array'])}
						{if:$good['is_send'] != 2}

			<label class="col-sm-8">
				<input type="radio" name="order_goods_id" value="{$good['id']}" />
								<a class="blue" href="{url:/site/products/id/$good['goods_id']}" target='_blank'>{$good_info['name']}{if:$good_info['value']}{$good_info['value']}{/if} X {$good['goods_nums']}件</a>
				
			</label>

						{/if}
						{/foreach}
		</div>

		</div>


		<div class="form-group">
			<label for="input" class="col-sm-2 control-label">退款理由:</label>
			<div class="col-sm-10">
				<textarea name="content" id="content" style="width:95%;height:300px" pattern="required"></textarea>
			</div>


		</div>


		<div class="form-group">

			<div class="col-sm-10 col-sm-offset-2">
				<button type="submit" class="btn  btn-block" style="width:95%">提交退款</button>
			</div>

		</div>


			
		</form>
	</div>
</div>

<script type="text/javascript">
//编辑器载入
KindEditorObj = KindEditor.create('#content',
{
	items : [
		'fontsize', '|', 'forecolor','bold', 'italic', 'underline',
		'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
		'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});

//提交表单检查
function checkForm()
{
	if($('#content').val() == '')
	{
		alert('请填写退款原因');
		return false;
	}

	if($('[name="order_goods_id"]:checked').length == 0)
	{
		alert('请选择要退款的商品');
		return false;
	}
	return true;
}
</script>